﻿ <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EmpManager.aspx.cs" Inherits="FPC.Offer.UI.MangerEmp.EmpShow" %>

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link href="../H-ui/static/h-ui/css/H-ui.min.css" rel="stylesheet" />
    <link href="../H-ui/static/h-ui.admin/css/H-ui.admin.css" rel="stylesheet" />
    <link href="../H-ui/Lib/Hui-iconfont/1.0.8/iconfont.css" rel="stylesheet" />
    <link href="../H-ui/static/h-ui.admin/skin/default/skin.css" rel="stylesheet" />
    <link href="../H-ui/static/h-ui.admin/css/style.css" rel="stylesheet" />
    <link href="../H-ui/Lib/layer/2.4/skin/layer.css" rel="stylesheet" />
    <title>人员管理</title>
</head>
<body>
    <nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 用户中心 <span class="c-gray en">&gt;</span> 用户管理 <a class="btn btn-success radius r" style="line-height: 1.6em; margin-top: 3px" href="../javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a></nav>
    <div class="page-container">
        <div class="text-c">
            <input type="text" class="input-text" style="width: 250px" placeholder="输入会员名称" id="text1" name="">
            <button type="submit" class="btn btn-success radius" onclick="SearchUser()" name=""><i class="Hui-iconfont">&#xe665;</i> 搜用户</button>
        </div>
        <div class="cl pd-5 bg-1 bk-gray mt-20"><span class="l"><%--<a href="javascript:;" onclick="datadel()" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a> --%><a href="javascript:;" onclick="member_add('添加用户', 'EmpAdd.aspx', '', '510')" class="btn btn-primary radius"><i class="Hui-iconfont">&#xe600;</i> 添加用户</a></span> <span class="r">共有数据：<strong>88</strong> 条</span> </div>
        <div class="mt-20">
            <table class="table table-border table-bordered table-hover table-bg table-sort">
                <thead>
                    <tr class="text-c">
                        <th width="60">
                            <input type="checkbox" onclick="attrchekcbox()" id="checkex">全选</th>
                        <th width="110">ID</th>
                        <th width="100">用户名</th>
                        <th width="40">性别</th>
                        <th width="90">手机</th>
                        <th width="150">邮箱</th>
                        <th width="150">部门</th>
                        <th width="100">地址</th>
                        <th width="70">状态</th>
                        <th width="100">操作</th>
                    </tr>
                </thead>
                <tbody id="tbody">
               </tbody>
            </table>
        </div>
    </div>
    <!--_footer 作为公共模版分离出去-->
    <script src="../H-ui/Lib/jquery/1.9.1/jquery.min.js"></script>
    <script src="../H-ui/Lib/layer/2.4/layer.js"></script>
    <script src="../H-ui/static/h-ui/js/H-ui.js"></script>
    <script src="../H-ui/static/h-ui.admin/js/H-ui.admin.js"></script>
    <!--/_footer 作为公共模版分离出去-->
    <script type="text/javascript">
 
        $(function () {
            /* 显示*/
            showOrsearch();

        })
        /* 查询*/
        function SearchUser() {
            showOrsearch();
        }
        /* 显示和查询*/

        function showOrsearch() {
            
            $("#tbody").empty();
            $.ajax({
                url: "../GeneralProcessor/MangerEmp/EmpManager.ashx",
                type: "post",
                data: {
                    Actioon: "<%=FPC.Offer.Common.EnumAction.Select %>",
                    name: $("#text1").val()
                },
                success: function (n) {

                    var data = JSON.parse(n);
                    var tr = new Array();
                    $(data).each(function (i, item) {
                        var m = "";
                        var states = "";
                        switch (item.UserSex) {
                            case "1": m = '男'; break;
                            case "2": m = '女'; break;
                            case "3": m = '保密'; break;
                        }
                        switch (item.PoliticalStatus) {
                            case 1: states = "在职"; break;
                            case 2: states = "请假"; break;
                            case 3: states = "退休"; break;
                        }
                        tr.push("<tr class='text-c'>");
                        tr.push("<td><input type='checkbox' class='b' value=" + item.UserId + "></td>");
                        tr.push("  <td>" + item.UserId + "</td>");
                        tr.push(" <td><a href='EmpShow.aspx?id=" + item.UserId + "'><u style='cursor:pointer' class='text-primary' onclick='member_show('张三','EmpShow.aspx'?id=+" + item.UserId + ",'10001','360','400')'>" + item.UserName + "</u></a></td> ");
                        tr.push(" <td>" + m + "</td>");
                        tr.push(" <td>" + item.UserTel + "</td>");
                        tr.push("<td>" + item.UserEmail + "</td>");
                        tr.push("<td>" + item.OrganizeName + "</td>");
                        tr.push(" <td>" + item.UserAddress + "</td>");
                        tr.push("<td>" + states + "</td>");                   
                        tr.push(" <td class='td-manage'><a href='EmpUpt.aspx?id=" + item.UserId + "'><i class='Hui-iconfont'>&#xe6df;</i></a> <a title='删除' href='#' onclick='del(" + item.UserId + ")' class='ml-5' style='text-decoration:none'><i class='Hui-iconfont'>&#xe6e2;</i></a></td>")
                        tr.push("</tr>")

                    })
                    $("#tbody").append(tr.join(""));
                }
            })
        }

        /*删除*/
        function del(n) {

            $.ajax({
                url: "../GeneralProcessor/MangerEmp/EmpManager.ashx",
                type: "post",
                data: {
                    Actioon: "<%=FPC.Offer.Common.EnumAction.Delete %>",
                    id: n
                },
                success: function (n) {
                    if (n > 0) {
                        layer.alert('删除成功！')
                        history.go(-1);
                        location.href = "EmpManager.aspx";
                    }
                    else {
                       layer.alert('删除失败！')
                    }
                }
            })
        }
        /*用户-添加*/
        function member_add(title, url, w, h) {

            layer_show(title, url, w, h);
        }
    </script>
</body>
</html>